<!DOCTYPE html>
<html lang="en">
<head>
    <title>{dede:global.cfg_webname/}</title>
    {dede:include filename="common_head.htm"/}
</head>
<body>
    <div class="main-wrap trial-wrap">
        {dede:include filename="header.htm"/}
        {dede:include filename="banner_inner.htm"/}
        <div class="content">
            <!-- free trial function -->
            <div class="content-item-wrap free-trial-wrap">
                <div class="container">
                    <div class="text-c content-title-wrap">
                        <div class="title">免费体验</div>
                        <div class="title-line"></div>
                        <div class="subtitle">我们用专业的技术为您保驾护航</div>
                    </div>
                    <div class="flex rsb content-con-wrap">
                        <div class="left-wrap w45 pic-wrap trial-ad-wrap">
                            <img src="{dede:global.cfg_templets_skin/}/img/img_ad_system.png" alt="" class="pic-img w100 h100 trial-ad-img" />
                        </div>
                        <div class="right-wrap w40 trial-con-wrap">
                            <form action="" class="form-wrap trial-form-wrap">
                                <div class="form-item-wrap">
                                    <div class="flex rcs form-title-wrap">
                                        <span class="title cur">*</span>
                                        <span class="title">店铺名称</span>
                                    </div>
                                    <input type="text" name="company" id="company" class="w100 form-item-input" placeholder="请输入店铺名称" />
                                </div>
                                <div class="form-item-wrap">
                                    <div class="flex rcs form-title-wrap">
                                        <span class="title cur">*</span>
                                        <span class="title">联系人</span>
                                    </div>
                                    <input type="text" name="contact" id="contact" class="w100 form-item-input" placeholder="请输入联系人名称" />
                                </div>
                                <div class="form-item-wrap">
                                    <div class="flex rcs form-title-wrap">
                                        <span class="title cur">*</span>
                                        <span class="title">联系方式</span>
                                    </div>
                                    <input type="text" name="mobile" id="mobile" class="w100 form-item-input" placeholder="请输入联系方式" />
                                </div>
                                <div class="mt-3 btn-wrap form-btn-wrap">
                                    <div class="flex ccc cur-p btn-item submit-btn-item" onclick="submitApply();">立即体验</div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        {dede:include filename="footer.htm"/}
        {dede:include filename="common_script.htm"/}
    </div>
    <script>
        // 提交申请
        function submitApply() {
            var formWrap = $('.trial-form-wrap');

            var _company = $('#company'),
                _companyVal = _company.val();

            var _contact = $('#contact'),
                _contactVal = _contact.val();

            var _mobile = $('#mobile'),
                _mobileVal = _mobile.val();

            var _dateStr = new Date(),
                _currentDate = _dateStr.Format("yyyy-MM-dd hh:mm:ss");


            if (_companyVal == '') {
                layer.msg('请输入你们的店铺名称');
                _company.focus();
                return false;
            }

            if (_contactVal == '') {
                layer.msg('请输入您的姓名');
                _contact.focus();
                return false;
            }

            if (_mobileVal == '') {
                layer.msg('请输入您的手机号');
                _mobile.focus();
                return false;
            } else if (!/^1[0-9]{10}/.test(_mobileVal)) {
                layer.msg('手机号格式不正确');
                _mobile.focus();
                return false;
            }


            var dataString =
                'company=' + _companyVal +
                '&contact=' + _contactVal +
                '&mobile=' + _mobileVal +
                '&create_time=' + _currentDate +
                '&ip=' + returnCitySN["cip"] +
                '&seo_engine=' + _seo_engine +
                '&action=post' +
                '&diyid=2&do=2' +
                '&dede_fields=company,text;contact,text;mobile,text;create_time,text;ip,text;seo_engine,text' +
                '&dede_fieldshash=d03aa8f1ff76b131222f5d4e9d94001b';

            $.ajax({
                type: "POST",
                url: "/plus/diy.php",
                data: dataString,
                success: function(data) {
                    formWrap[0].reset();
                    layer.msg('提交成功');
                }
            });

            // layer.msg('确认要提交申请吗？', {
            //     time: 0,
            //     btn: ['确定', '取消'],
            //     yes: function(index) {
            //         layer.close(index);
            //         $.ajax({
            //             type: "POST",
            //             url: "/plus/diy.php",
            //             data: dataString,
            //             success: function(data) {
            //                 formWrap[0].reset();
            //             }
            //         });
            //     }
            // });
            return false;
            
        }
    </script>
</body>
</html>